-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: Add support for Streamable HTTP Transport MCP servers #4210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add support for Streamable HTTP Transport MCP servers #4210
Conversation
… to currently be actually leveraged
|
Hey @hannesrudolph - chatted with you a handful of times on reddit but this is my first upstream roo PR, let me know if I missed anything from the contribution guide. I read through CONTRIBUTING.md and shot you a ping on discord. Thanks! btw the failing test ( |
|
Fixed unrelated failing tests with this branch @mrubens mentioned |
…eamable_http_support
|
Thanks for this! Will take a look ASAP. I rolled back the PR that broke tests but I can look at applying your fix there as a follow up. |
Awesome, appreciate it! The test fix changes can be pruned from the branch cleanly just by dropping that one file so can totally do that but fwiw fix looked good if useful 👍 |
| // Streamable HTTP connection | ||
| transport = new StreamableHTTPClientTransport(new URL(configInjected.url), { | ||
| requestInit: { | ||
| headers: configInjected.headers, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to add this hack in #4148 to make headers work with SSE - do you know if it's also needed for streamable? Hopefully not 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm good call, may not be necessary but wanted it match the existing patterns
Looking at it, EventSource can’t natively send arbitrary request headers from the browser, so #4148 injects them through the polyfill’s custom fetch hook. 
StreamableHTTPClientTransport opens its connection with fetch() under the hood. Because it relies on plain fetch, anything you put in options.requestInit.headers is forwarded automatically; no special shim is required.
The only gotcha is to pass the options object as the second (not third) argument to the transport constructor. Don’t think it poses any usability issues as is, didn’t in my testing but want to make everything clean and tidy can poke at it in the am
mrubens
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you! One question about the headers but even if we need something additional we can do it as a follow-up.

Detailed Feature Request: #4218
Implement MCP Streamable HTTP Support in same manner as SSE & stdio
The existing pinned version of the client SDK already supports Streamable HTTP transport—this PR simply exposes that capability in our extension alongside the existing stdio and SSE options.
I've been watching several efforts related to implementing Streamable HTTP but they seem to be tied to enormous refactors that fundamentally change the Roo backend and haven't been updated in nearly a month, so I figured others might benefit from my local branch, which cleanly adds streamable HTTP support in the same manner as stdio and SSE are implemented exactly.
Related GitHub Issue
Opened an issue at #4216
Will close that, #3627 and #2131
Description
This pull request introduces support for a new Model Context Protocol (MCP) server type:
streamable-http. This allows Roo Code to connect to MCP servers that use a streamable HTTP-based transport, expanding its integration capabilities.Key changes include:
src/services/mcp/McpHub.ts):StreamableHTTPClientTransportfrom the MCP SDK.McpConnectiontype to includeStreamableHTTPClientTransport.validateServerConfig) to:streamable-httptype.streamable-httpconfigurations (e.g., requiring aurl).urlexplicitly define theirtypeas eithersseorstreamable-http.connectServermethod to:StreamableHTTPClientTransportforstreamable-httptype servers.onerrorandonclosehandlers for this new transport type, similar to the existingSSEClientTransport.src/__mocks__/@modelcontextprotocol/sdk/client/streamable-http.jsto mock theStreamableHTTPClientTransportfor testing purposes.Test Procedure
McpHub.tsto ensure they cover the new validation logic forstreamable-httpconfigurations.streamable-httpconnection attempts, error handling, and successful connections using the new mock.settings.jsonwithtype: "streamable-http"and a valid (or mock)url.Type of Change
srcor test files.Pre-Submission Checklist
npm run lint).console.log) has been removed.npm test).mainbranch.npm run changesetif this PR includes user-facing changes or dependency updates.Screenshots / Videos
Showing it running with Google Workspace MCP via Streamable HTTP

Documentation Updates
There is seemingly no references to MCP setup present in the README.md so I did not include that in the scope of this PR. Happy to add it myself, will follow with a second separate PR that covers stdio, sse & streamable-http. User-facing documentation regarding MCP server configuration will need to be updated to include the new
streamable-httptype, its purpose, and its specific configuration options (url, optionalheaders).Additional Notes
This change aligns the MCP client capabilities more closely with the available transport mechanisms in the
@modelcontextprotocol/sdk.Get in Touch
taylorwilsdon
Important
Adds
streamable-httptransport support for MCP servers inMcpHub.ts, including validation and connection handling.streamable-httpsupport inMcpHub.tsfor MCP servers, allowing connections via streamable HTTP transport.validateServerConfigto recognizestreamable-httptype and requireurl.connectToServerto handleStreamableHTTPClientTransportinstantiation and error handling.streamable-http.jsmock forStreamableHTTPClientTransportinsrc/__mocks__for testing.This description was created by
for 1fc6d52. You can customize this summary. It will automatically update as commits are pushed.